import request from '@/utils/request'

export function treeMenuList(){
    return request({
        url: '/mini/menu/tree',
        method: 'get',
    })
}

export function menuList(params){
    return  request({
        url: '/mini/menu/list',
        method: 'get',
        params
    })
}

export function addMenu(data){
    return request({
        url: '/mini/menu/add',
        method: 'post',
        data
    })
}

export function editMenu(data){
    return request({
        url: '/mini/menu/edit',
        method: 'post',
        data
    })
}
export function queryMenu(menuId){
    return request({
        url: '/mini/menu/queryById',
        method: 'get',
        params: {menuId}
    })
}

export function deleteMenu(menuId){
    return request({
        url: '/mini/menu/delete/' + menuId,
        method: 'post'
    })
}

export function getService(menuId){
    return request({
        url: '/mini/service/get',
        method: 'get',
        params: {menuId}
    })
}

export function updateService(service){
    return request({
        url: '/mini/service/edit',
        method: 'post',
        data: service
    })
}

export function addService(service){
    return request({
        url: '/mini/service/add',
        method: 'post',
        data: service
    })
}

export function getStandards(serviceId){
    return request({
        url: '/mini/standards/list',
        method: 'get',
        params: {serviceId}
    })
}

export function addStandards(standardsForm){
    return request({
        url: '/mini/standards/add',
        method: 'post',
        data: standardsForm
    })
}

export function deleteStandards(serviceStandardsId){
    return request({
        url: `/mini/standards/delete?serviceStandardsId=${serviceStandardsId}`,
        method: 'post'
    })
}

export function updateStandards(standardsForm){
    console.log("#",standardsForm);
    return request({
        url: '/mini/standards/edit',
        method: 'post',
        data: standardsForm
    })
}



